<!DOCTYPE html>
<html class="no-js">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>Protocol</title>
    <link href="../../../images/logo-icon.svg" rel="icon" type="image/svg">
    <script>var pathToRoot = "../../../";</script>
    <script>document.documentElement.classList.replace("no-js","js");</script>
    <script>const storage = localStorage.getItem("dokka-dark-mode")
    if (storage == null) {
        const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
        if (osDarkSchemePreferred === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    } else {
        const savedDarkMode = JSON.parse(storage)
        if(savedDarkMode === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    }
    </script>
<script type="text/javascript" src="https://unpkg.com/kotlin-playground@1/dist/playground.min.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script>
<link href="../../../styles/style.css" rel="Stylesheet">
<link href="../../../styles/main.css" rel="Stylesheet">
<link href="../../../styles/prism.css" rel="Stylesheet">
<link href="../../../styles/logo-styles.css" rel="Stylesheet">
<link href="../../../styles/font-jb-sans-auto.css" rel="Stylesheet">
<link href="../../../ui-kit/ui-kit.min.css" rel="Stylesheet">
<script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/main.js" defer="defer"></script>
<script type="text/javascript" src="../../../scripts/prism.js" async="async"></script>
<script type="text/javascript" src="../../../ui-kit/ui-kit.min.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/symbol-parameters-wrapper_deferred.js" defer="defer"></script>
</head>
<body>
    <div class="root">
<nav class="navigation" id="navigation-wrapper">
    <div class="navigation--inner">
        <div class="navigation-title">
            <button class="menu-toggle" id="menu-toggle" type="button">toggle menu</button>
            <div class="library-name">
                    <a class="library-name--link" href="../../../index.html">
                            MCP Kotlin SDK
                    </a>
            </div>
            <div class="library-version">
1.0-SNAPSHOT            </div>
        </div>
        <div class="filter-section" id="filter-section">
                <button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":/main">jvm</button>
        </div>
    </div>
    <div class="navigation-controls">
        <button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button>
        <div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div>
    </div>
</nav>
        <div id="container">
            <div class="sidebar" id="leftColumn">
                <div class="sidebar--inner" id="sideMenu"></div>
            </div>
            <div id="main">
<div class="main-content" data-page-type="classlike" id="content" pageIds="MCP Kotlin SDK::org.jetbrains.kotlinx.mcp.shared/Protocol///PointingToDeclaration//-251573632">
  <div class="breadcrumbs"><a href="../../../index.html">MCP Kotlin SDK</a><span class="delimiter">/</span><a href="../index.html">org.jetbrains.kotlinx.mcp.shared</a><span class="delimiter">/</span><span class="current">Protocol</span></div>
  <div class="cover ">
    <h1 class="cover"><span><span>Protocol</span></span></h1>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">abstract </span><span class="token keyword">class </span><a href="index.html">Protocol</a><span class="token operator">&lt;</span><a href="index.html">SendRequestT</a><span class="token operator"> : </span><a href="../../org.jetbrains.kotlinx.mcp/-request/index.html">Request</a><span class="token punctuation">, </span><a href="index.html">SendNotificationT</a><span class="token operator"> : </span><a href="../../org.jetbrains.kotlinx.mcp/-notification/index.html">Notification</a><span class="token punctuation">, </span><a href="index.html">SendResultT</a><span class="token operator"> : </span><a href="../../org.jetbrains.kotlinx.mcp/-request-result/index.html">RequestResult</a><span class="token operator">&gt;</span><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">_options<span class="token operator">: </span><a href="../-protocol-options/index.html">ProtocolOptions</a><span class="token operator">?</span></span></span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/e5l/mcp-kotlin-sdk/org/jetbrains/kotlinx/mcp/shared/Protocol.kt#L109">source</a>)</span></span></div><p class="paragraph">Implements MCP protocol framing on top of a pluggable transport, including features like request/response linking, notifications, and progress.</p><h4 class="">Inheritors</h4><div class="table"><div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><a href="../../org.jetbrains.kotlinx.mcp.client/-client/index.html">Client</a></div></span></div><div></div></div></div><div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><a href="../../org.jetbrains.kotlinx.mcp.server/-server/index.html">Server</a></div></span></div><div></div></div></div></div></div></div>
  </div>
  <div class="tabbedcontent">
    <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button></div>
    <div class="tabs-section-body">
      <div data-togglable="CONSTRUCTOR">
        <h2 class="">Constructors</h2>
        <div class="table"><a data-name="-1738755166%2FConstructors%2F-251573632" anchor-label="Protocol" id="-1738755166%2FConstructors%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-togglable="CONSTRUCTOR" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-protocol.html"><span><span>Protocol</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1738755166%2FConstructors%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">_options<span class="token operator">: </span><a href="../-protocol-options/index.html">ProtocolOptions</a><span class="token operator">?</span></span></span><span class="token punctuation">)</span></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div data-togglable="PROPERTY">
        <h2 class="">Properties</h2>
        <div class="table"><a data-name="674710522%2FProperties%2F-251573632" anchor-label="fallbackNotificationHandler" id="674710522%2FProperties%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="fallback-notification-handler.html"><span>fallback</span><wbr></wbr><span>Notification</span><wbr></wbr><span><span>Handler</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="674710522%2FProperties%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">var </span><a href="fallback-notification-handler.html">fallbackNotificationHandler</a><span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span>notification<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-j-s-o-n-r-p-c-notification/index.html">JSONRPCNotification</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator">?</span></div><div class="brief "><p class="paragraph">A handler to invoke for any notification types that do not have their own handler installed.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-144660058%2FProperties%2F-251573632" anchor-label="fallbackRequestHandler" id="-144660058%2FProperties%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="fallback-request-handler.html"><span>fallback</span><wbr></wbr><span>Request</span><wbr></wbr><span><span>Handler</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-144660058%2FProperties%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">var </span><a href="fallback-request-handler.html">fallbackRequestHandler</a><span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span>request<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-j-s-o-n-r-p-c-request/index.html">JSONRPCRequest</a><span class="token punctuation">, </span>extra<span class="token operator">: </span><a href="../-request-handler-extra/index.html">RequestHandlerExtra</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="index.html">SendResultT</a><span class="token operator">?</span><span class="token operator">?</span></div><div class="brief "><p class="paragraph">A handler to invoke for any request types that do not have their own handler installed.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-644417585%2FProperties%2F-251573632" anchor-label="notificationHandlers" id="-644417585%2FProperties%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="notification-handlers.html"><span>notification</span><wbr></wbr><span><span>Handlers</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-644417585%2FProperties%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">val </span><a href="notification-handlers.html">notificationHandlers</a><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html">MutableMap</a><span class="token operator">&lt;</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span><span class="token keyword">suspend </span><span class="token punctuation">(</span>notification<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-j-s-o-n-r-p-c-notification/index.html">JSONRPCNotification</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator">&gt;</span></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="452449902%2FProperties%2F-251573632" anchor-label="transport" id="452449902%2FProperties%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="transport.html"><span><span>transport</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="452449902%2FProperties%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">var </span><a href="transport.html">transport</a><span class="token operator">: </span><a href="../-transport/index.html">Transport</a><span class="token operator">?</span></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div data-togglable="FUNCTION">
        <h2 class="">Functions</h2>
        <div class="table"><a data-name="686313821%2FFunctions%2F-251573632" anchor-label="assertCapabilityForMethod" id="686313821%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="assert-capability-for-method.html"><span>assert</span><wbr></wbr><span>Capability</span><wbr></wbr><span>For</span><wbr></wbr><span><span>Method</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="686313821%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">abstract </span><span class="token keyword">fun </span><a href="assert-capability-for-method.html"><span class="token function">assertCapabilityForMethod</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">method<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-method/index.html">Method</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">A method to check if a capability is supported by the remote side, for the given method to be called.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="730305500%2FFunctions%2F-251573632" anchor-label="assertRequestHandlerCapability" id="730305500%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="assert-request-handler-capability.html"><span>assert</span><wbr></wbr><span>Request</span><wbr></wbr><span>Handler</span><wbr></wbr><span><span>Capability</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="730305500%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">abstract </span><span class="token keyword">fun </span><a href="assert-request-handler-capability.html"><span class="token function">assertRequestHandlerCapability</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">method<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-method/index.html">Method</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">A method to check if a request handler is supported by the local side, for the given method to be handled.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="358863743%2FFunctions%2F-251573632" anchor-label="close" id="358863743%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="close.html"><span><span>close</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="358863743%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="close.html"><span class="token function">close</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Closes the connection.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1765908736%2FFunctions%2F-251573632" anchor-label="connect" id="-1765908736%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="connect.html"><span><span>connect</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1765908736%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="connect.html"><span class="token function">connect</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">transport<span class="token operator">: </span><a href="../-transport/index.html">Transport</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Attaches to the given transport, starts it, and starts listening for messages.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-53416532%2FFunctions%2F-251573632" anchor-label="notification" id="-53416532%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="notification.html"><span><span>notification</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-53416532%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="notification.html"><span class="token function">notification</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">notification<span class="token operator">: </span><a href="index.html">SendNotificationT</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Emits a notification, which is a one-way message that does not expect a response.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1472804194%2FFunctions%2F-251573632" anchor-label="onclose" id="-1472804194%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="onclose.html"><span><span>onclose</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1472804194%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">fun </span><a href="onclose.html"><span class="token function">onclose</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Callback for when the connection is closed for any reason.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="2059060411%2FFunctions%2F-251573632" anchor-label="onerror" id="2059060411%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="onerror.html"><span><span>onerror</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="2059060411%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">fun </span><a href="onerror.html"><span class="token function">onerror</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">error<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Callback for when an error occurs.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="722924334%2FFunctions%2F-251573632" anchor-label="removeNotificationHandler" id="722924334%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="remove-notification-handler.html"><span>remove</span><wbr></wbr><span>Notification</span><wbr></wbr><span><span>Handler</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="722924334%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="remove-notification-handler.html"><span class="token function">removeNotificationHandler</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">method<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-method/index.html">Method</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Removes the notification handler for the given method.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1923370666%2FFunctions%2F-251573632" anchor-label="removeRequestHandler" id="-1923370666%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="remove-request-handler.html"><span>remove</span><wbr></wbr><span>Request</span><wbr></wbr><span><span>Handler</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1923370666%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="remove-request-handler.html"><span class="token function">removeRequestHandler</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">method<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-method/index.html">Method</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Removes the request handler for the given method.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="1559262167%2FFunctions%2F-251573632" anchor-label="request" id="1559262167%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="request.html"><span><span>request</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1559262167%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="request.html">T</a><span class="token operator"> : </span><a href="../../org.jetbrains.kotlinx.mcp/-request-result/index.html">RequestResult</a><span class="token operator">&gt; </span><a href="request.html"><span class="token function">request</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">request<span class="token operator">: </span><a href="index.html">SendRequestT</a><span class="token punctuation">, </span></span><span class="parameter ">options<span class="token operator">: </span><a href="../-request-options/index.html">RequestOptions</a><span class="token operator">?</span><span class="token operator"> = </span>null</span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="request.html">T</a></div><div class="brief "><p class="paragraph">Sends a request and wait for a response.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-2077210981%2FFunctions%2F-251573632" anchor-label="setNotificationHandler" id="-2077210981%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="set-notification-handler.html"><span>set</span><wbr></wbr><span>Notification</span><wbr></wbr><span><span>Handler</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-2077210981%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="set-notification-handler.html">T</a><span class="token operator"> : </span><a href="../../org.jetbrains.kotlinx.mcp/-notification/index.html">Notification</a><span class="token operator">&gt; </span><a href="set-notification-handler.html"><span class="token function">setNotificationHandler</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">method<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-method/index.html">Method</a><span class="token punctuation">, </span></span><span class="parameter ">handler<span class="token operator">: </span><span class="token punctuation">(</span>notification<span class="token operator">: </span><a href="set-notification-handler.html">T</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator">&gt;</span></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a handler to invoke when this protocol object receives a notification with the given method.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1611105308%2FFunctions%2F-251573632" anchor-label="setRequestHandler" id="-1611105308%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="set-request-handler.html"><span>set</span><wbr></wbr><span>Request</span><wbr></wbr><span><span>Handler</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1611105308%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="set-request-handler.html">T</a><span class="token operator"> : </span><a href="../../org.jetbrains.kotlinx.mcp/-request/index.html">Request</a><span class="token operator">&gt; </span><a href="set-request-handler.html"><span class="token function">setRequestHandler</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">method<span class="token operator">: </span><a href="../../org.jetbrains.kotlinx.mcp/-method/index.html">Method</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">noinline </span>block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><a href="set-request-handler.html">T</a><span class="token punctuation">, </span><a href="../-request-handler-extra/index.html">RequestHandlerExtra</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="index.html">SendResultT</a><span class="token operator">?</span></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a handler to invoke when this protocol object receives a request with the given method.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
    <div class="footer">
        <a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>
        <span>© 2024 Copyright</span>
        <span class="pull-right">
            <span>Generated by </span>
            <a class="footer--link footer--link_external" href="https://github.com/Kotlin/dokka">
                <span>dokka</span>
            </a>
        </span>
    </div>
            </div>
        </div>
    </div>
</body>
</html>